/**   
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-09 17:24:07  
 * Copyright (c) 2015- joysuch-版权所有     
 */

package com.joysuch.wwyt.bp.entity;

import cn.hutool.core.builder.EqualsBuilder;
import cn.hutool.core.builder.HashCodeBuilder;
import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import java.io.Serializable;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "wwyt_bp_exam_assess")
@SQLDelete(sql = "update wwyt_bp_exam_assess set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update wwyt_bp_exam_assess set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")

public class BpExamAssess implements Serializable {

    // columns START
    // ID，主键
    private Long id;
    // 考核标准ID
    private Long examId;
    // 考核编号
    private String num;
    // 考核人员ID
    private Long examPersonId;
    // 考核时间
    private java.util.Date examTime;
    // 考官ID
    private Long examinerId;
    // 考核项目集合
    private String itemExam;
    // 考核结果
    private Float itemExamScore;
    // 创建人
    private Long createBy;
    // 创建时间
    private java.util.Date createTime;
    // 更新人
    private Long updateBy;
    // 更新时间
    private java.util.Date updateTime;
    // 删除标记
    private String deleteFlag;
    // 组织机构代码
    private String orgCode;
    // 租户
    private Long tenentId;
    // columns END
    // 状态
    private Integer state;
    // 部门ID
    private Long departId;

    private String departName;
    public void setId(Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    @Column(name = "EXAM_ID", length = 100)
    public Long getExamId() {
        return this.examId;
    }

    public void setExamId(Long value) {
        this.examId = value;
    }

    @Column(name = "STATE")
    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    @Column(name = "NUM", length = 10)
    public String getNum() {
        return this.num;
    }

    public void setNum(String value) {
        this.num = value;
    }

    @Column(name = "EXAM_PERSON_ID")
    public Long getExamPersonId() {
        return this.examPersonId;
    }

    public void setExamPersonId(Long value) {
        this.examPersonId = value;
    }

    @Column(name = "EXAM_TIME")
    public java.util.Date getExamTime() {
        return this.examTime;
    }

    public void setExamTime(java.util.Date value) {
        this.examTime = value;
    }

    @Column(name = "EXAMINER_ID", length = 500)
    public Long getExaminerId() {
        return this.examinerId;
    }

    public void setExaminerId(Long value) {
        this.examinerId = value;
    }

    @Column(name = "ITEM_EXAM", length = 500)
    public String getItemExam() {
        return this.itemExam;
    }

    public void setItemExam(String value) {
        this.itemExam = value;
    }

    @Column(name = "ITEM_EXAM_SCORE")
    public Float getItemExamScore() {
        return this.itemExamScore;
    }

    public void setItemExamScore(Float value) {
        this.itemExamScore = value;
    }

    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public Long getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(Long value) {
        this.createBy = value;
    }

    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.util.Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(java.util.Date value) {
        this.createTime = value;
    }

    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public Long getUpdateBy() {
        return this.updateBy;
    }

    public void setUpdateBy(Long value) {
        this.updateBy = value;
    }

    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.util.Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(java.util.Date value) {
        this.updateTime = value;
    }

    @Column(name = "DELETE_FLAG", length = 2)
    public String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(String value) {
        this.deleteFlag = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(String value) {
        this.orgCode = value;
    }

    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(Long value) {
        this.tenentId = value;
    }

    @Column(name = "DEPART_ID")
    public Long getDepartId() {
        return this.departId;
    }

    public void setDepartId(Long departId) {
        this.departId = departId;
    }
    @Transient
    public String getDepartName() {
        return departName;
    }
    public void setDepartName(String departName) {
        this.departName = departName;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
                .append("examId", getExamId()).append("num", getNum()).append("examPersonId", getExamPersonId())
                .append("examTime", getExamTime()).append("examinerId", getExaminerId())
                .append("itemExam", getItemExam()).append("itemExamScore", getItemExamScore())
                .append("createBy", getCreateBy()).append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime())
                .append("deleteFlag", getDeleteFlag()).append("orgCode", getOrgCode()).append("tenentId", getTenentId())
                .append("departId", getDepartId()).append("departName", getDepartName())
                .toString();
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BpExamAssess == false)
            return false;
        if (this == obj)
            return true;
        BpExamAssess other = (BpExamAssess) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
